package handler

import (
	"api/basic/global"
	__ "api/basic/proto"
	"api/internal/params"
	"github.com/gin-gonic/gin"
	"net/http"
)

func VideoReview(c *gin.Context) {
	var req *params.VideoReviewReq

	if err := c.ShouldBindJSON(&req); err != nil {
		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
		return
	}

	add, err := global.VideoClient.AuditVideo(c, &__.AuditVideoReq{
		VideoId: int64(req.VideoId),
	})
	if err != nil {
		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
		return
	}

	c.JSON(http.StatusOK, gin.H{
		"code": 200,
		"msg":  "审核结束",
		"data": add,
	})

}
